package java101;

import java.util.Scanner;

import javax.swing.JOptionPane;

public class FibonacciQuotient {

	static Scanner sc = new Scanner(System.in);	

	public static void main(String[] args) {

		String inputOne = JOptionPane.showInputDialog
		("Enter the first starting number: ");
		int first = Integer.parseInt(inputOne);
		if (first > 1000) {
			first = 1000;
		}
		else if (first < 0) {
			first = 0;
		}
		
		String inputTwo = JOptionPane.showInputDialog
		("Enter the second starting number: ");
		int second = Integer.parseInt(inputTwo);
		if (second > 1000) {
			second = 1000;
		}
		else if (second < 0) {
			second = 0;
		}

		int total;
		
		double phi = (1 + Math.sqrt(5)) / 2;

		System.out.println(first);

		System.out.println(second);

		for (int i=0; i<25; i++)

		{

			total = first + second ;

			double 	quotient = (double) total / second ;
			
			double phiDivide = (double) quotient - phi;
			
			double phiAbsolute = Math.abs(phiDivide);

			String format = String.format("%d + %d = %d, q = %.4f, diff = %.13f", first , second , total, quotient, phiAbsolute);
			

			System.out.println(format);

			first  = second ;

			second  = total;

		}
		System.out.println();
		System.out.println("For the quotient, it always resolves as 1.618...");
		System.out.println("For the difference, the numbers seem to get progressively smaller...");

	}



}

